function getItem(
  label: VueElement | string,
  key: string,
  icon?: any,
  children?: ItemType[],
  type?: 'group'
): ItemType {
  return {
    key,
    icon,
    children,
    label,
    type,
  } as ItemType
}
import { h } from 'vue'

import Health from './icon/Health.vue'
import Drugs from './icon/Drugs.vue'
import Community from './icon/Community.vue'
import Home from './icon/Home.vue'
import User from './icon/User.vue'
import News from './icon/News.vue'

// 医生权限
export const doctorOperate = [
  getItem('首页', 'sub1', () => h(Home)),
  getItem('论坛管理', 'sub3', () => h(News), [
    getItem('帖子管理', '301'),
    getItem('评论管理', '302'),
  ]),
  getItem('药品管理', 'sub4', () => h(Drugs), [
    getItem('药品列表', '401'),
    getItem('药品库管理', '402'),
  ]),
  getItem('医疗服务', 'sub5', () => h(Health), [
    getItem('服务管理', '501'),
    getItem('就诊服务', '502'),
  ]),
  getItem('用户管理', 'sub6', () => h(User), [getItem('医生排班', '602')]),
]
// 管理员权限
export const Operate = [
  getItem('首页', 'sub1', () => h(Home)),
  getItem('论坛管理', 'sub3', () => h(News), [
    getItem('帖子管理', '301'),
    getItem('评论管理', '302'),
  ]),
  getItem('用户管理', 'sub6', () => h(User), [getItem('用户列表', '601')]),
]

//超级管理员权限
export const adminOperate = [
  getItem('首页', 'sub1', () => h(Home)),
  getItem('社区管理', 'sub2', () => h(Community), [getItem('社区列表', '201')]),
  getItem('论坛管理', 'sub3', () => h(News), [
    getItem('帖子管理', '301'),
    getItem('评论管理', '302'),
  ]),
  getItem('药品管理', 'sub4', () => h(Drugs), [
    getItem('药品列表', '401'),
    getItem('药品库管理', '402'),
  ]),
  getItem('医疗服务', 'sub5', () => h(Health), [getItem('服务管理', '501')]),
  getItem('用户管理', 'sub6', () => h(User), [
    getItem('用户列表', '601'),
    getItem('医生排班', '602'),
  ]),
]
